using System.Collections;
using UnityEngine;

public class Player : BaseObject
{
	public StateMachine<Player> stateMachine;

	public PlayerAI AI;

	public PlayerType playerType;

	public Player paraPlayer;

	public Team team;

	public TeamType teamType;

	public HeightType heightType;

	public Transform trans_LeftHand;

	public Transform trans_RightHand;

	public Transform trans_Head;

	public Transform trans_RootBone;

	public Transform trans_ball;

	public bool isControlBall;

	public bool isUserRightHand;

	public Vector3 pos_pre;

	public int jumpShootLevel;

	public bool shoot_layup_is_far;

	public bool shoot_is_layup;

	public bool shoot_is_dunk;

	public float shoot_target_sqr_distance;

	public bool steal_is_success;

	public bool rebound_is_success;

	public bool block_is_success;

	public bool block_is_foul;

	public int wait_frame;

	public Vector3 bassline_targetPos;

	public Vector3 acceptbasslineball_targetPos;

	public bool defense_is__will_handup;

	public bool defense_is_handuped;

	public float defense_handup_time;

	public bool dribblerun_is_charging;

	public bool updownup_is_turnaround;

	public bool catch_is_normal_catch;

	private Transform trans_hair;

	public int number;

	private Material material_clothe;

	private Material material_num;

	private Material material_skin;

	public float timeGoRight;

	public bool isSingleCrossOver;

	public bool isRootMotion;

	private Texture textureNum;

	public GameObject ojShadow;

	public GameObject ojEffect;

	public GameObject ojEffect_Fire;

	public GameObject ojEffect_Light;

	public GameObject ojEffect_Ice;

	private void OnDestroy()
	{
		textureNum = null;
		if (ojEffect != null)
		{
			ojEffect = null;
		}
		if (ojEffect_Fire != null)
		{
			ojEffect_Fire = null;
		}
		if (ojEffect_Light != null)
		{
			ojEffect_Light = null;
		}
		if (ojEffect_Ice != null)
		{
			ojEffect_Ice = null;
		}
	}

	private new void Awake()
	{
		base.Awake();
		stateMachine = new StateMachine<Player>(this);
		AI = new PlayerAI(this);
		pos_pre = getPosition();
		timeGoRight = Random.Range(1f, 5f);
		if (MyScreen.phoneType == PhoneType.LOW || MyScreen.phoneType == PhoneType.MIDDLE)
		{
			UnityEngine.Object.Destroy(ojShadow);
			ojShadow = null;
		}
		if (MyScreen.phoneType == PhoneType.LOW)
		{
			return;
		}
		material_skin = (Resources.Load("fuzhuangskin", typeof(Material)) as Material);
		Material[] materials = GetComponentInChildren<SkinnedMeshRenderer>().materials;
		for (int i = 0; i < materials.Length; i++)
		{
			if (materials[i].name.StartsWith("fu"))
			{
				materials[i] = material_skin;
				break;
			}
		}
		SkinnedMeshRenderer componentInChildren = GetComponentInChildren<SkinnedMeshRenderer>();
		componentInChildren.materials = materials;
	}

	public void getEffect(bool isIce, bool IsFire, bool isLight)
	{
		if (MyScreen.phoneType == PhoneType.LOW || MyScreen.phoneType == PhoneType.MIDDLE || UnityEngine.SceneManagement.SceneManager.GetActiveScene().buildIndex == 4)
		{
			return;
		}
		if (ojEffect_Ice != null)
		{
			ojEffect_Ice.gameObject.SetActiveRecursively(state: false);
		}
		if (ojEffect_Fire != null)
		{
			ojEffect_Fire.gameObject.SetActiveRecursively(state: false);
		}
		if (ojEffect_Light != null)
		{
			ojEffect_Light.gameObject.SetActiveRecursively(state: false);
		}
		if (isIce)
		{
			if (ojEffect_Ice == null)
			{
				ojEffect_Ice = (Object.Instantiate(Resources.Load("Effect/2", typeof(GameObject)) as GameObject) as GameObject);
			}
			ojEffect_Ice.gameObject.SetActiveRecursively(state: true);
			ojEffect = ojEffect_Ice;
			ojEffect.transform.parent = base.transform;
			ojEffect.transform.localPosition = Vector3.zero;
		}
		else if (IsFire)
		{
			if (ojEffect_Fire == null)
			{
				ojEffect_Fire = (Object.Instantiate(Resources.Load("Effect/1", typeof(GameObject)) as GameObject) as GameObject);
			}
			ojEffect_Fire.gameObject.SetActiveRecursively(state: true);
			ojEffect = ojEffect_Fire;
			ojEffect.transform.parent = base.transform;
			ojEffect.transform.localPosition = Vector3.zero;
		}
		else if (isLight)
		{
			if (ojEffect_Light == null)
			{
				ojEffect_Light = (Object.Instantiate(Resources.Load("Effect/0", typeof(GameObject)) as GameObject) as GameObject);
			}
			ojEffect_Light.gameObject.SetActiveRecursively(state: true);
			ojEffect = ojEffect_Light;
			ojEffect.transform.parent = base.transform;
			ojEffect.transform.localPosition = Vector3.zero;
		}
	}

	private void FixedUpdate()
	{
		stateMachine.fixedUpdate();
		if (teamType == TeamType.COMPUTER || (team != null && (this != team.getPlayer_ControlBall() || team.getIsAllAI())))
		{
			AI.fixedUpdate();
		}
		if (MyScreen.phoneType == PhoneType.HIGH)
		{
			ojShadow.transform.LookAt(MathHelper.setX(ojShadow.transform.position, -10f));
		}
	}

	public void setClothe(Texture texture, int clotheIndex)
	{
		getMaterial_Clothe().mainTexture = texture;
		if (MyScreen.phoneType != 0)
		{
			if (MathHelper.isArrayHaveNum(Global.clotheColor_Red_ClotheIndex, clotheIndex))
			{
				getMaterial_Num().color = Global.clotheColor_Red;
			}
			else if (MathHelper.isArrayHaveNum(Global.clotheColor_Orange_ClotheIndex, clotheIndex))
			{
				getMaterial_Num().color = Global.clotheColor_Orange;
			}
			else if (MathHelper.isArrayHaveNum(Global.clotheColor_Black_ClotheIndex, clotheIndex))
			{
				getMaterial_Num().color = Global.clotheColor_Black;
			}
			else if (MathHelper.isArrayHaveNum(Global.clotheColor_White_ClotheIndex, clotheIndex))
			{
				getMaterial_Num().color = Global.clotheColor_White;
			}
		}
	}

	public void setSkin(int skin)
	{
		switch (skin)
		{
		case 1:
			getMaterial_Clothe().SetColor("_MainColor", new Color(188f / 255f, 0.647058845f, 149f / 255f, 1f));
			break;
		case 2:
			getMaterial_Clothe().SetColor("_MainColor", new Color(118f / 255f, 27f / 85f, 19f / 85f, 1f));
			break;
		case 3:
			getMaterial_Clothe().SetColor("_MainColor", new Color(23f / 255f, 0.0117647061f, 0.0117647061f, 1f));
			break;
		default:
			LogUtils.Error("skin wrong");
			break;
		}
	}

	public void setNum(int _number, int indexInNumber)
	{
		number = _number;
		if (MyScreen.phoneType == PhoneType.LOW)
		{
			SkinnedMeshRenderer componentInChildren = GetComponentInChildren<SkinnedMeshRenderer>();
			if (!(componentInChildren == null) && componentInChildren.materials != null)
			{
				componentInChildren.materials = new Material[1]
				{
					componentInChildren.materials[0]
				};
			}
		}
		else
		{
			textureNum = (Resources.Load("Number/haoma0" + indexInNumber, typeof(Texture)) as Texture);
			getMaterial_Num().mainTexture = textureNum;
			getMaterial_Num().SetTextureOffset("_MainTex", new Vector2(LoadData.numberOffsetX[number], LoadData.numberOffsetY[number]));
		}
	}

	public void setHair(Transform _transform, Vector3 offest)
	{
		_transform.position = MathHelper.setOffsetXYZ(getPosition(), offest.x, offest.y, offest.z);
		_transform.parent = trans_Head;
		trans_hair = _transform;
	}

	private Material getMaterial_Num()
	{
		if (MyScreen.phoneType == PhoneType.LOW)
		{
			return null;
		}
		if (material_num != null)
		{
			return material_num;
		}
		Material[] materials = GetComponentInChildren<SkinnedMeshRenderer>().materials;
		for (int i = 0; i < materials.Length; i++)
		{
			if (materials[i].name.StartsWith("haoma"))
			{
				material_num = materials[i];
				break;
			}
		}
		return material_num;
	}

	public Material getMaterial_Clothe()
	{
		if (material_clothe != null)
		{
			return material_clothe;
		}
		Material[] materials = GetComponentInChildren<SkinnedMeshRenderer>().materials;
		for (int i = 0; i < materials.Length; i++)
		{
			if (materials[i].name.StartsWith("fu"))
			{
				material_clothe = materials[i];
				break;
			}
		}
		return material_clothe;
	}

	public override void setMirrorAnimation()
	{
		if (MyScreen.phoneType == PhoneType.LOW)
		{
			return;
		}
		base.setMirrorAnimation();
		if (team.data.data_player_hair[(int)playerType] != 0)
		{
			Vector3 localScale = base.transform.localScale;
			if (Mathf.Approximately(localScale.x, -1f) && trans_hair != null)
			{
				trans_hair.localScale = new Vector3(-1f, 1f, 1f);
			}
		}
		Instance<Ball>.instance.myTransform.localScale = new Vector3(-1f, 1f, 1f);
		StartCoroutine("setMirror");
		if (MyScreen.phoneType != 0)
		{
			getMaterial_Num().SetTextureScale("_MainTex", new Vector2(-1f, 1f));
			getMaterial_Num().SetTextureOffset("_MainTex", new Vector2(0f - LoadData.numberMirrorOffsetX[number], LoadData.numberMirrorOffsetY[number]));
		}
	}

	public override void setNormalAnimation()
	{
		base.setNormalAnimation();
		StopCoroutine("setMirror");
		if (team.data.data_player_hair[(int)playerType] != 0)
		{
			Vector3 localScale = base.transform.localScale;
			if (Mathf.Approximately(localScale.x, 1f) && trans_hair != null)
			{
				trans_hair.localScale = Vector3.one;
			}
		}
		Instance<Ball>.instance.myTransform.localScale = Vector3.one;
		if (team.ojPlayEffect != null && team.ojPlayEffect.transform.parent == trans_RootBone)
		{
			team.ojPlayEffect.transform.localScale = Vector3.one;
		}
		if (MyScreen.phoneType != 0)
		{
			getMaterial_Num().SetTextureScale("_MainTex", new Vector2(1f, 1f));
			getMaterial_Num().SetTextureOffset("_MainTex", new Vector2(LoadData.numberOffsetX[number], LoadData.numberOffsetY[number]));
		}
	}

	public override void setPositon(Vector3 pos)
	{
		if (heightType == HeightType.BIG)
		{
			pos = MathHelper.setY(pos, Global.HeightOffest_Big);
		}
		else if (heightType == HeightType.SMALL)
		{
			pos = MathHelper.setY(pos, 0f - Global.HeightOffest_Small);
		}
		base.setPositon(pos);
	}

	public override void LookAt(Vector3 pos)
	{
		Vector3 vec = pos;
		Vector3 position = getPosition();
		pos = MathHelper.setY(vec, position.y);
		base.LookAt(pos);
	}

	public override void LookAtSmooth(Vector3 pos)
	{
		Vector3 vec = pos;
		Vector3 position = getPosition();
		pos = MathHelper.setY(vec, position.y);
		base.LookAtSmooth(pos);
	}

	public void do_shoot()
	{
		isControlBall = false;
		jumpShootLevel = 1;
		changeState(PlayerStateBehavior_Shoot.getInstance());
		Instance<Court>.instance.OnShoot(this);
	}

	public void do_freethrow()
	{
		isControlBall = false;
		changeState(PlayerStateBehavior_FreeThrow.getInstance());
	}

	public void do_block()
	{
		isControlBall = false;
		changeState(PlayerStateBehavior_Block.getInstance());
	}

	public void do_steal()
	{
		isControlBall = false;
		changeState(PlayerStateBehavior_Steal.getInstance());
	}

	public void do_steal_grab()
	{
		isControlBall = false;
		changeState(PlayerStateBehavior_Steal_Grab.getInstance());
	}

	public void do_rebound()
	{
		isControlBall = false;
		changeState(PlayerStateBehavior_Rebound.getInstance());
	}

	public void do_run()
	{
		isControlBall = false;
		changeState(PlayerStateBehavior_Run.getInstance());
	}

	public void do_walk()
	{
		isControlBall = false;
		changeState(PlayerStateBehavior_Walk.getInstance());
	}

	public void do_pass()
	{
		isControlBall = false;
		changeState(PlayerStateBehavior_PassBall.getInstance());
	}

	public void do_idle()
	{
		isControlBall = false;
		changeState(PlayerStateBehavior_Idle.getInstance());
	}

	public void do_jump()
	{
		isControlBall = false;
		changeState(PlayerStateBehavior_Jump.getInstance());
	}

	public void do_jumpball()
	{
		isControlBall = false;
		changeState(PlayerStateBehavior_JumpBall.getInstance());
	}

	public void do_opening()
	{
		isControlBall = false;
		changeState(PlayerStateBehavior_Opening.getInstance());
	}

	public void do_dribble_run()
	{
		isControlBall = true;
		changeState(PlayerStateBehavior_Dribble_Run.getInstance());
	}

	public void do_dribble_stay()
	{
		isControlBall = true;
		changeState(PlayerStateBehavior_Dribble_Stay.getInstance());
	}

	public void do_defense()
	{
		isControlBall = false;
		changeState(PlayerStateBehavior_Defense.getInstance());
	}

	public void do_defense_back()
	{
		isControlBall = false;
		changeState(PlayerStateBehavior_Defense_Back.getInstance());
	}

	public void do_catch()
	{
		isControlBall = true;
		changeState(PlayerStateBehavior_CatchBall.getInstance());
	}

	public void do_callball()
	{
		isControlBall = false;
		changeState(PlayerStateBehavior_CallBall.getInstance());
	}

	public void do_baseline()
	{
		isControlBall = false;
		changeState(PlayerStateBehavior_BaseLineThrow.getInstance());
	}

	public void do_tumble()
	{
		isControlBall = false;
		changeState(PlayerStateBehavior_Tumble.getInstance());
	}

	public void do_updownup()
	{
		isControlBall = true;
		changeState(PlayerStateBehavior_UpDownUp.getInstance());
	}

	public void changeState(State<Player> state)
	{
		if (!isInState(state))
		{
			stateMachine.changeState(state);
		}
	}

	public bool isInState(State<Player> state)
	{
		return stateMachine.isInState(state);
	}

	public void OnJumpBall()
	{
		AI.OnJumpBall();
		AI.do_idle();
	}

	public void OnCatchBall()
	{
		do_catch();
	}

	public bool IsOffense()
	{
		return team.getIsOffense();
	}

	public bool IsBeingDefense()
	{
		return DSS.IsBeingDefense(this, getParaTeam().getPlayer_ClosestToTarget(getPosition()).getPosition());
	}

	public bool IsTeamCrossHalfCourt()
	{
		return team.getIsCrossHalfCourt();
	}

	public bool IsCrossHalfCourt()
	{
		int result;
		if (getOffenseDirection() == OffenseDirection.LEFT)
		{
			Vector3 position = getPosition();
			result = ((position.z > 0f) ? 1 : 0);
		}
		else
		{
			Vector3 position2 = getPosition();
			result = ((position2.z < 0f) ? 1 : 0);
		}
		return (byte)result != 0;
	}

	public bool IsCanBlock()
	{
		Vector3 vec = (team.offenseDirection != OffenseDirection.RIGHT) ? Global.posBallIn_Right_Ground : Global.posBallIn_Left_Ground;
		if (Instance<Ball>.instance.isInState(BallState_Shoot.getInstance()) && MathHelper.getSqrDistance(getPosition(), Instance<Ball>.instance.shoot_player.getPosition()) < 2.25f && MathHelper.getSqrDistance(getPosition(), vec) < MathHelper.getSqrDistance(Instance<Ball>.instance.shoot_player.getPosition(), vec) && MathHelper.getSqrDistance(getPosition(), vec) < MathHelper.getSqrDistance(MathHelper.setY(Instance<Ball>.instance.getPosition(), 0f), vec))
		{
			return true;
		}
		return false;
	}

	public bool IsFastBreak()
	{
		if (getOffenseDirection() == OffenseDirection.LEFT)
		{
			Vector3 position = getPosition();
			if (position.z < Global.posBallIn_Left_Ground.z)
			{
				for (int i = 0; i < 5; i++)
				{
					if (team.getPlayer(i).playerType != playerType)
					{
						Vector3 position2 = team.getPlayer(i).getPosition();
						float z = position2.z;
						Vector3 position3 = getPosition();
						if (z > position3.z)
						{
							return false;
						}
					}
					Vector3 position4 = getParaTeam().getPlayer(i).getPosition();
					float z2 = position4.z;
					Vector3 position5 = getPosition();
					if (z2 > position5.z)
					{
						return false;
					}
				}
			}
		}
		else
		{
			Vector3 position6 = getPosition();
			if (position6.z > Global.posBallIn_Right_Ground.z)
			{
				for (int j = 0; j < 5; j++)
				{
					if (team.getPlayer(j).playerType != playerType)
					{
						Vector3 position7 = team.getPlayer(j).getPosition();
						float z3 = position7.z;
						Vector3 position8 = getPosition();
						if (z3 < position8.z)
						{
							return false;
						}
					}
					Vector3 position9 = getParaTeam().getPlayer(j).getPosition();
					float z4 = position9.z;
					Vector3 position10 = getPosition();
					if (z4 < position10.z)
					{
						return false;
					}
				}
			}
		}
		return true;
	}

	public OffenseDirection getOffenseDirection()
	{
		return team.offenseDirection;
	}

	public float getThreaten()
	{
		return DSS.GetThreaten(getPosition(), getOffenseDirection() == OffenseDirection.LEFT);
	}

	public bool isHaveDunkType(DunkType dunkType)
	{
		//if (!GameData.IsFinishTutorial && TutorialController.preTutorialType != TutorialType.Game_RealGame)
		//{
		//	return true;
		//}
		if (teamType == TeamType.USER)
		{
			switch (dunkType)
			{
			case DunkType.NORMAL:
				return true;
			case DunkType.TWOHAND:
				if (GameData.IsUnlockAction[5])
				{
					return true;
				}
				break;
			case DunkType.ONEHAND:
				if (GameData.IsUnlockAction[1])
				{
					return true;
				}
				break;
			case DunkType.CROSSLEG:
				if (GameData.IsUnlockAction[8])
				{
					return true;
				}
				break;
			case DunkType.TURNAROUND:
				if (GameData.IsUnlockAction[7])
				{
					return true;
				}
				break;
			case DunkType.BACK:
				if (GameData.IsUnlockAction[3])
				{
					return true;
				}
				break;
			case DunkType.CROSSLEG2:
				if (GameData.IsUnlockAction[10])
				{
					return true;
				}
				break;
			case DunkType.ONEHAND_FAR:
				if (GameData.IsUnlockAction[2])
				{
					return true;
				}
				break;
			}
			return false;
		}
		return true;
	}

	public bool isHaveLayupType(LayupType layupType)
	{
		//if (!GameData.IsFinishTutorial && TutorialController.preTutorialType != TutorialType.Game_RealGame)
		//{
		//	return false;
		//}
		if (teamType == TeamType.USER)
		{
			switch (layupType)
			{
			case LayupType.NORMAL:
				return true;
			case LayupType.BACK:
				if (GameData.IsUnlockAction[4])
				{
					return true;
				}
				break;
			case LayupType.EUROSTEP:
				if (GameData.IsUnlockAction[6])
				{
					return true;
				}
				break;
			case LayupType.THROW:
				if (GameData.IsUnlockAction[0])
				{
					return true;
				}
				break;
			case LayupType.TURNAROUND:
				if (GameData.IsUnlockAction[9])
				{
					return true;
				}
				break;
			}
			return false;
		}
		return true;
	}

	public int getData_Pass()
	{
		int num = 0;
		num = ((teamType != 0) ? Instance<Court>.instance.teamComData[2] : (Instance<Court>.instance.teamUserData[2] + GameData.CoachAdd[(int)playerType, 2]));
		if (heightType == HeightType.NORMAL)
		{
			num += 10;
		}
		return num;
	}

	public int getData_Shoot(int i)
	{
		int num = 0;
		if (team.indexInTeamData == 30 || team.indexInTeamData == 31 || playerType == (PlayerType)team.data.data_star)
		{
			num = 15;
		}
		if (teamType == TeamType.USER)
		{
			switch (i)
			{
			case 1:
			case 2:
				if (heightType == HeightType.NORMAL)
				{
					return Instance<Court>.instance.teamUserData[0] + 10 + GameData.CoachAdd[(int)playerType, 0] + num;
				}
				return Instance<Court>.instance.teamUserData[0] + num;
			case 3:
				if (heightType == HeightType.SMALL)
				{
					return Instance<Court>.instance.teamUserData[1] + 10 + GameData.CoachAdd[(int)playerType, 1] + num;
				}
				return Instance<Court>.instance.teamUserData[1] + num;
			}
		}
		else
		{
			switch (i)
			{
			case 1:
			case 2:
				if (heightType == HeightType.NORMAL)
				{
					return Instance<Court>.instance.teamComData[0] + 10 + num;
				}
				return Instance<Court>.instance.teamComData[0] + num;
			case 3:
				if (heightType == HeightType.SMALL)
				{
					return Instance<Court>.instance.teamComData[1] + 10 + num;
				}
				return Instance<Court>.instance.teamComData[1] + num;
			}
		}
		LogUtils.Error("shoot data not find");
		return 0;
	}

	public int getData_Steal()
	{
		int num = 0;
		num = ((teamType != 0) ? Instance<Court>.instance.teamComData[5] : (Instance<Court>.instance.teamUserData[5] + GameData.CoachAdd[(int)playerType, 5]));
		if (heightType == HeightType.SMALL)
		{
			num += 10;
		}
		return num;
	}

	public int getData_Rebound()
	{
		int num = 0;
		num = ((teamType != 0) ? Instance<Court>.instance.teamComData[4] : (Instance<Court>.instance.teamUserData[4] + GameData.CoachAdd[(int)playerType, 4]));
		if (heightType == HeightType.BIG)
		{
			num += 10;
		}
		return num;
	}

	public int getData_Block()
	{
		int num = 0;
		num = ((teamType != 0) ? Instance<Court>.instance.teamComData[6] : (Instance<Court>.instance.teamUserData[6] + GameData.CoachAdd[(int)playerType, 6]));
		if (heightType == HeightType.BIG)
		{
			num += 10;
		}
		return num;
	}

	public int getData_Physical()
	{
		if (teamType == TeamType.USER)
		{
			return Instance<Court>.instance.teamUserData[7];
		}
		return Instance<Court>.instance.teamComData[7];
	}

	public int getData_Speed()
	{
		if (teamType == TeamType.USER)
		{
			return Instance<Court>.instance.teamUserData[3];
		}
		return Instance<Court>.instance.teamComData[3];
	}

	public int getData_Level()
	{
		if (teamType == TeamType.USER)
		{
			return GameData.TeamLevel[team.indexInTeamData];
		}
		return UIChooseTeam.comLevel;
	}

	public Vector3 getParaPlayerPositon()
	{
		return paraPlayer.getPosition();
	}

	public Team getParaTeam()
	{
		return paraPlayer.team;
	}

	public Vector3 getOffenseBasketPos()
	{
		return (getOffenseDirection() != 0) ? Global.posBallIn_Right_Ground : Global.posBallIn_Left_Ground;
	}

	public Vector3 getDefenseBasketPos()
	{
		return (getOffenseDirection() != 0) ? Global.posBallIn_Left_Ground : Global.posBallIn_Right_Ground;
	}

	public void OnEarlyShootEnd()
	{
		if (!Instance<Court>.instance.isInState(CourtStateFreeThrow.getInstance()))
		{
			if (teamType != 0)
			{
				base.GetComponent<Animation>()[AnimationName.player_shoot_normal].time = base.GetComponent<Animation>()[AnimationName.player_shoot_early].time;
				base.GetComponent<Animation>().Play(AnimationName.player_shoot_normal);
				jumpShootLevel = 2;
			}
			else if (Instance<UIGame>.instance.isPressingShoot)
			{
				base.GetComponent<Animation>()[AnimationName.player_shoot_normal].time = base.GetComponent<Animation>()[AnimationName.player_shoot_early].time;
				base.GetComponent<Animation>().Play(AnimationName.player_shoot_normal);
				jumpShootLevel = 2;
			}
		}
	}

	public void OnNormalShootEnd()
	{
		if (teamType == TeamType.USER && !Instance<Court>.instance.isInState(CourtStateFreeThrow.getInstance()) && Instance<UIGame>.instance.isPressingShoot)
		{
			base.GetComponent<Animation>()[AnimationName.player_shoot_late].time = base.GetComponent<Animation>()[AnimationName.player_shoot_normal].time;
			base.GetComponent<Animation>().Play(AnimationName.player_shoot_late);
			jumpShootLevel = 3;
		}
	}

	public float getMoveSpeed()
	{
		float num = 0f;
		if (heightType == HeightType.BIG)
		{
			return 4.3f + (float)(getData_Speed() - 6) * 0.4f;
		}
		if (heightType == HeightType.SMALL)
		{
			return 4.7f + (float)(getData_Speed() - 6) * 0.4f;
		}
		return 4.5f + (float)(getData_Speed() - 6) * 0.4f;
	}

	public void getBallOutHand()
	{
		if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().buildIndex == 4)
		{
			Instance<Ball>.instance.getBallOutHand();
		}
	}

	public void getBallInHand()
	{
		Instance<Ball>.instance.getBallInHand(trans_ball);
	}

	public bool isBallInHand()
	{
		if (Instance<Ball>.instance.myTransform.parent == trans_ball)
		{
			return true;
		}
		return false;
	}

	public void playDribbleSound()
	{
		Instance<AudioController>.instance.play(AudioType.Sound_ball_dribble);
	}

	private IEnumerator setMirror()
	{
		while (true)
		{
			yield return 0;
			if (trans_hair != null)
			{
				trans_hair.localScale = new Vector3(-1f, 1f, 1f);
			}
			Instance<Ball>.instance.myTransform.localScale = new Vector3(-1f, 1f, 1f);
			if (team.ojPlayEffect != null && team.ojPlayEffect.transform.parent == trans_RootBone)
			{
				team.ojPlayEffect.transform.localScale = new Vector3(-1f, 1f, 1f);
			}
		}
	}

	private IEnumerator rootMotionCom()
	{
		while (true)
		{
			yield return 0;
			if (ojShadow != null)
			{
				ojShadow.transform.position = MathHelper.setY(trans_RootBone.position, 0f);
			}
		}
	}
}
